<template>
  <view class="wrap">


    <u-form :model="orderDetail" label-width="200">
      <u-form-item label="客户名称" prop="clientName">
        <u-input v-model="orderDetail.clientName" />
      </u-form-item>
      <u-form-item label="商品名称" prop="goodsTitle">
        <u-input v-model="orderDetail.goodsTitle" />
      </u-form-item>
      <u-form-item label="数量" prop="quantity">
        <u-input v-model="orderDetail.quantity" />
      </u-form-item>
      <u-form-item label="单价" prop="price">
        <u-input v-model="orderDetail.price" />
      </u-form-item>
      <u-form-item label="总价" prop="totalPrice">
        <u-input v-model="orderDetail.totalPrice" />
      </u-form-item>
      <u-form-item label="采购价" prop="purchasePrice">
        <u-input v-model="orderDetail.purchasePrice" />
      </u-form-item>
      <u-form-item label="采购总价" prop="intro">
        <u-input v-model="orderDetail.purchasePrice*orderDetail.quantity" />
      </u-form-item>
      <u-form-item label="开销" prop="intro">
        <u-input v-model="orderDetail.output" />
      </u-form-item>
      <u-form-item label="毛利" prop="intro">
        <u-input v-model="orderDetail.profit" />
      </u-form-item>
      <u-form-item label="发货状态" prop="intro">
        <u-input v-model="orderDetail.intro" />
      </u-form-item>
      <u-form-item label="录入时间" prop="intro">
        <u-input v-model="orderDetail.intro" />
      </u-form-item>
      <u-form-item label="采购人" prop="intro">
        <u-input v-model="orderDetail.intro" />
      </u-form-item>
      <u-form-item label="购买时间" prop="intro">
        <u-input v-model="orderDetail.intro" />
      </u-form-item>
      <u-form-item label="预录单" prop="intro">
        <u-input v-model="orderDetail.intro" />
      </u-form-item>
    </u-form>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        rules: {
          name: [{
            required: true,
            message: '请输入姓名',
            // 可以单个或者同时写两个触发验证方式
            trigger: 'blur,change'
          }],
          intro: [{
            min: 5,
            message: '简介不能少于5个字',
            trigger: 'change'
          }]
        },
        orderDetail: null,
        
      };
    },
    onLoad(options) {
      // console.log(options);
      if (options.item) {
        this.orderDetail = JSON.parse(decodeURIComponent(options.item))
        console.log('orderDetail', this.orderDetail);
      }
    }
    // 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
    // onReady() {
    //   this.$refs.uForm.setRules(this.rules);
    // }
  };
</script>

<style lang="scss" scoped>
  .wrap {
    padding: 20rpx;
  }
</style>